<template>
  <view class="my-userinfo-container">
    <!-- 头像昵称区域 -->
    <view class="top-box">
      <image src="userinfo.avatarUrl" class="avatar"></image>
      <view class="nickname">{{userinfo.nickName}}</view>
    </view>
  </view>
</template>

<script>
  import { mapState } from 'vuex'
  export default {
    computed: {
      ...mapState('m_user',['userinfo'])
    },
    name:"my-userinfo",
    data() {
      return {
        
      };
    }
  }
</script>

<style lang="scss">
.my-userinfo-container {
  height: 100%;
  // 为整个组件的结构添加浅灰色背景
  background-color: #f4f4f4;
  
  .top-box {
    height: 400rpx;
    background-color: #c00000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    .avatar {
      display: flex;
      width: 90px;
      height: 90px;
      border-radius: 45px;
      border: 2px solid white;
      box-shadow: 0 1px 1px black;
    }
    .nickname {
      color: white;
      font-size: 16px;
      font-weight: bold;
      margin-top: 10px;
    }
  }
}
</style>